package com.jl.jlapp.adapter;

import android.content.res.Resources;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.Evaluation;
import com.jl.jlapp.utils.CustomGridLayoutManager;
import java.util.ArrayList;
import java.util.List;

public class EvalSubmitSuccessAdapter
  extends BaseQuickAdapter<Evaluation, BaseViewHolder>
{
  GoodsEvaluationImageAdapter goodsEvaluationImageAdapter;
  List<ImageView> starts;
  
  public EvalSubmitSuccessAdapter(@LayoutRes int paramInt, @Nullable List<Evaluation> paramList)
  {
    super(paramInt, paramList);
  }
  
  protected void convert(BaseViewHolder paramBaseViewHolder, Evaluation paramEvaluation)
  {
    RecyclerView localRecyclerView = (RecyclerView)paramBaseViewHolder.getView(R.id.goods_eval_img_recycler_view);
    paramBaseViewHolder.setImageDrawable(R.id.should_evaluation_goods_img, paramBaseViewHolder.itemView.getResources().getDrawable(paramEvaluation.getGoodsImg().intValue()));
    paramBaseViewHolder.setText(R.id.edit_evaluation_content, paramEvaluation.getEvaluationMsg());
    ImageView localImageView1 = (ImageView)paramBaseViewHolder.getView(R.id.evaluation_star1);
    ImageView localImageView2 = (ImageView)paramBaseViewHolder.getView(R.id.evaluation_star2);
    ImageView localImageView3 = (ImageView)paramBaseViewHolder.getView(R.id.evaluation_star3);
    ImageView localImageView4 = (ImageView)paramBaseViewHolder.getView(R.id.evaluation_star4);
    ImageView localImageView5 = (ImageView)paramBaseViewHolder.getView(R.id.evaluation_star5);
    this.starts = new ArrayList();
    this.starts.add(localImageView1);
    this.starts.add(localImageView2);
    this.starts.add(localImageView3);
    this.starts.add(localImageView4);
    this.starts.add(localImageView5);
    int i = 0;
    while (i < 5)
    {
      ((ImageView)this.starts.get(i)).setImageDrawable(paramBaseViewHolder.itemView.getResources().getDrawable(R.drawable.icon_star_gray_s));
      i += 1;
    }
    i = 0;
    while (i < paramEvaluation.getStar().intValue())
    {
      ((ImageView)this.starts.get(i)).setImageDrawable(paramBaseViewHolder.itemView.getResources().getDrawable(R.drawable.icon_star_yellow_s));
      i += 1;
    }
    if ((paramEvaluation.getImages() != null) && (paramEvaluation.getImages().size() > 0))
    {
      localRecyclerView.setLayoutManager(new CustomGridLayoutManager(paramBaseViewHolder.itemView.getContext(), 5, false));
      this.goodsEvaluationImageAdapter = new GoodsEvaluationImageAdapter(2131361927, paramEvaluation.getImages());
      localRecyclerView.setAdapter(this.goodsEvaluationImageAdapter);
    }
  }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/EvalSubmitSuccessAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */